<template>
	<view class="box" v-if="isShow">
		<view class="flex flex-ai-c flex-jc-sb">
			<view class="flex flex-ai-c">
				<view class="head-img">
					<image :src="userinfo.receiveImg"></image>
				</view>
				<view style="margin-left: 20rpx;">
					<view>{{userinfo.receiveName}}</view>
					<view>邀请你视频通话</view>
				</view>
			</view>
			<view class="main-btn flex">
				<view class="refuse flex flex-jc-c flex-ai-c" @click="refuse">
					<text class="text">挂断</text>
				</view>
				<view class="accept flex flex-jc-c flex-ai-c" @click="accept">
					接听
				</view>
			</view>
		</view>
	</view>

</template>

<script setup lang="ts" name="Confirm">
	defineProps<{
		isShow : boolean,
		duration ?: number,
		userinfo ?: any,
		accept : () => void,
		refuse : () => void,
	}>()
</script>

<style lang="scss" scoped>
	.box {
		
		font-size: 24rpx;
		width: 100%;
		animation: slideInDown 1s;
		border-radius: 12rpx;
		position: fixed;
		top: 0;
		left: 50%;
		opacity: 0.9;
		transform: translate3d(-50%, 0, 0);
		z-index: 9999;
		background: rgb(39, 40, 34);
		color: #fff;
		padding: 50rpx;
	}

	.main-btn {
		z-index: 999;
		color: #fff;

		.refuse {
			text-align: center;
			width: 80rpx;
			height: 80rpx;
			border-radius: 50%;
			font-size: 24rpx;
			background-color: rgb(235, 69, 73);
		}

		.accept {
			margin-left: 40rpx;
			text-align: center;
			width: 80rpx;
			height: 80rpx;
			font-size: 24rpx;
			border-radius: 50%;
			background-color: rgb(2, 212, 3);
		}
	}

	@keyframes slideInDown {
		from {
			-webkit-transform: translate3d(-50%, -100%, 0);
			transform: translate3d(-50%, -100%, 0);
			visibility: visible;
		}

		to {
			-webkit-transform: translate3d(-50%, 0px, 0);
			transform: translate3d(-50%, 0px, 0);
		}
	}
</style>